package com.example.musicrecommend.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.musicrecommend.model.dto.song.SongQueryRequest;
import com.example.musicrecommend.model.dto.song.SongSearchRequest;
import com.example.musicrecommend.model.entity.Song;
import com.example.musicrecommend.model.vo.SongVO;

import java.io.Serializable;

/**
* @author PERSON
* @description 针对表【song(歌曲)】的数据库操作Service
* @createDate 2024-10-02 00:41:20
*/
public interface SongService extends IService<Song> {

    /**
     * 获取查询条件
     * @param songQueryRequest
     * @return
     */
    QueryWrapper<SongVO> getQueryWrapper(SongQueryRequest songQueryRequest);

    /**
     * 获取模糊查询条件
     * @param songSearchRequest
     * @return
     */
    QueryWrapper<SongVO> getQueryWrapper(SongSearchRequest songSearchRequest);

    /**
     * 参数校验
     * @param song
     * @param isAdd
     */
    void validSong(Song song, boolean isAdd);

    SongVO getSongById(Serializable id);

    Page<SongVO> selectSongsPage(Page<SongVO> page, Wrapper<SongVO> queryWrapper);

}
